Method of controlling comb-cutter lathe

ABSTRACT

A method of controlling a comb-cutter lathe in which one face of a tool rest (TBS) is provided with two or more juxtaposed tools (TL1, TL2) for subjecting a workpiece (WK) to machining by using: (1) predetermined tools in succession, (2) part dimensions, (3) a tool selection sequence, (4) a machining start location for each tool, and (5) mounting dimension information measured from a reference point on the tool rest to a distal end of each tool. Machining is sequentially performed based on this information by predetermined tools at machining locations (P 5  -P 4  -P 3  -P 2  -P 1  ; P 6  -P 7  -P 8  -P 9  -P 10 ) assigned to the tools, and after machining is completed by a first tool (TL1), the tool rest (TBS) is moved to position the next tool (TL2) at a machining location and machining is performed by that tool. The method includes moving the tool rest along a Z axis to a point P r  at which none of the tools (TL1, TL2) will contact the workpiece (WK) when the tool rest (TBS) is moved in a direction (X-axis direction) at right angles to the longitudinal direction (Z-axis direction) of the workpiece, and thereafter moving the tool rest along the X axis to a point P t  at which an X-axis position of a selected tool coincides with an X-axis coordinate value of a position at which machining is to be started by the selected tool, and thenforth performing machining using the selected tool.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is related to copending U.S. patent application U.S. Ser. No. 621,927.

BACKGROUND OF THE INVENTION

This invention relates to a method of controlling a comb-cutter lathe in which one face of a tool rest is provided with two or more juxtaposed tools for subjecting a workpiece to machining by using predetermined tools in succession.

When it becomes necessary to change tools in an ordinary turret lathe, the turret is moved to a position where the tools will not interfere with a stationary part of the machine or with the workpiece even when the turret is rotated. The turret is then rotated to select the desired tool, and the selected tool is positioned at a machining starting point. Machining is then performed by the selected tool. Since a turret lathe thus requires moving the turret to a tool changing position, selecting a tool by rotation of the turret, and positioning the turret at a machining starting point, a comparatively long period of time is needed to select a tool. In machining a small article that requires a machining time of from 10 seconds to several minutes, the amount of time needed for tool selection cannot be ignored. In particular, where a large number of lots are concerned, a reduction in the tool selection time is desired. To achieve a machining time reduction a comb-cutter lathe has come into use because it has a plurality of tools provided in juxtaposition on one face of a tool rest, with predetermined ones of the tools being used one after another to machine a workpiece. An advantage of a comb-cutter lathe of this kind is that tool selection time is shortened since it is unnecessary to rotate the tool rest when selecting a tool. With a comb-cutter lathe, however, it is necessary to slide the tool rest when selecting a tool, and to arrange the tools so that they do not interfere with the workpiece when sliding takes place.

SUMMARY OF THE INVENTION

Accordingly, an object of the present invention is to provide a method of controlling a comb-cutter lathe wherein a tool will not interfere with a workpiece when a tool rest is slid during tool selection.

Another object of the present invention is to provide a method of controlling a comb-cutter lathe wherein the path of a tool rest at the time of a tool selection is generated automatically.

A further object of the present invention is to provide a method of controlling a comb-cutter lathe wherein the path of a tool rest at the time of a tool selection can be shortened to enable a reduction in the time needed for the tool selection.

The present invention provides a method of controlling a comb-cutter lathe wherein machining at machining locations assigned to respective tools mounted on a tool rest is performed in sequential fashion, and after completion of machining performed by one tool, the tool rest is moved in order to position a subsequent tool at a machining location where machining is to be performed by that tool. The method includes: (1) moving the tool rest along a Z axis (longitudinal direction) to a point P_(r) at which none of the tools will contact the workpiece when the tool rest is moved in a direction (X-axis direction) at right angles to the longitudinal direction (Z-axis direction) of the workpiece, and (2) thereafter moving the tool rest along the X axis to a point P_(t) at which an X-axis position of a selected tool will coincide with an X-axis coordinate value of a position at which machining is to be started by the tool, and thenceforth performing machining using a selected tool. According to the invention, a tool will not interfere with the workpiece when a tool is selected, and tools can be changed along the shortest path.

BRIEF DESCRIPTION OF THE DRAWINGS

FIGS. 1(A)-1(D) illustrate the machining performed by a comb-cutter lathe;

FIG. 2 is a block diagram of an automatic programming apparatus to which the present invention appertains;

FIGS. 3(A)-3(C) illustrate a flowchart of the processing for creating a part program according to the present invention;

FIG. 4 illustrates a tool path according to the present invention;

FIG. 5 illustrates the final contour of a part as displayed on a CRT;

FIG. 6 shows an example of data input for each machining process for machining the contour shown in FIG. 5;

FIG. 7 shows tool mounting positions on a comb-cutter tool rest;

FIG. 8 shows according to the present invention a created part program;

FIG. 9 is a block diagram of an NC apparatus; and

FIG. 10 is a flowchart for the processing to accomplish the machining performed by a comb-cutter lathe according to the present invention.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

FIGS. 1(A)-1(D) illustrate machining performed by a comb-cutter lathe in which one face of a tool rest TBS is provided with two tools TL1 and TL2 in juxtaposition. We will assume that a workpiece WK having a stock contour indicated by the dashed line is to be machined into the part contour indicated by the solid line, and that the portion P₁ -P₂ -P₃ -P₄ -P₅ of the part contour is to be subjected to coarse machining in the first quadrant by the tool TL1, which is for coarse machining, and that the portion P₆ -P₇ -P₈ -P₉ -P₁₀ of the part contour is to be subjected to fine machining in the fourth quadrant by the tool TL2, which is for fine machining. The workpiece WK has a turning axis which coincides with the Z axis shown in FIGS. 1(A)-1(D).

First, the tool TL1 is moved as in turning work performed by an ordinary turret lathe (see the fine lines in the first quadrant of FIG. 1(A)) to provide a coarse machined part contour indicated by P₁ -P₂ . . . -P₅ (see FIG. 1(B)).

Next, assuming that fine machining must be performed in the fourth quadrant by the tool TL2, a Z-axis position P_(r) (FIG. 1(B)) determined so that the tools TL1 and TL2 will not contact the workpiece WK when the tool rest TBS is moved along the X axis. The tool rest TBS is then moved to the position P_(r) (FIG. 1(C)).

Thereafter, the tool rest TBS is transported along the X axis to a point P_(t) [FIG. 1(D)] where the X-axis position of the tool TL2 for fine machining coincides with the X-axis coordinate value of a position P₆ where machining performed by the tool is to start. Thenceforth, the tool rest is transported along the path P₆ →P₇ →P₈ →P₉ →P₁₀ to perform fine machining with the selected tool TL2.

To perform the foregoing control in accordance with the present invention, NC data is created from: (1) the part dimensions, (2) the tool selection sequence, (3) the machining location of each tool and reference positions of the respective tools. The data is stored in memory and control is effected by reading the NC data out of the memory one block at a time.

The method of controlling a comb-cutter lathe according to the present invention now be described in two parts, namely (I) processing for creating an NC part program, and (II) processing for machining performed by a comb-cutter lathe.

(I) Processing for creating an NC part program

(1) First, a keyboard 101 and display unit 102 shown in FIG. 2 are used to enter data specifying (1) the external shape of the workpiece WK, e.g., coordinate values x_(m), z_(m) (see FIG. 4) of a point P_(m), (2) part contour, e.g., coordinate values x_(i), z_(i) of a point P_(i) (i=1, 2 . . . 10), coordinate values x_(o), z_(o) of an initial position P_(o) of a tool, a clearance distance c used during coarse machining, a finishing allowance t, depth of cut d for one pass, finishing increment u, coarse cutting speed f_(c), and fine cutting speed f_(c) '. These data are stored in a RAM 103. Stock contour and part contour are displayed on the display unit 102, as shown in FIG. 5.

(2) Next, as shown in FIG. 6, the tool to be used (e.g., T1), the tool mounting position (e.g., ΔX1, ΔZ1) and the location to be machined by the tool (e.g., P₅, P₄, P₃, P₂, P₁) are entered and stored in the RAM 103 in the desired order of machining. The tool used is expressed by the letter of the alphabet "T" and a one-digit numerical value following "T". The tool mounting position, as shown in FIG. 7, is expressed by the distance (actually incremental values along the corresponding axes) from a reference point R on the tool rest TBS to the tool respective noses of tools TL1, TL2, TL3. The tool used and the mounting position of the tool are specified by entering a tool number "T□" and incremental values "ΔXi, ΔZi" for each of the prescribed tools. The location to be machined by each tool is specified by point numbers P₁, P₂ . . . P₂₄ (FIG. 5). Specifically, a machining location is specified by entering these numbers into RAM 103 from the keyboard 101. Thus, information for first, second and third machining processes is stored in the RAM 103 and is given by the following:

T₁ :ΔX₁, ΔZ₁ :P₅, P₄, P₃, P₂, P₁ ;

T₂ :ΔX₂, ΔZ₂ :P₆, P₇, P₈, P₉, P₁₀ ;

T₃ :ΔX₃, ΔZ₃ :P₂₁, P₂₂, P₂₃, P₂₄

assuming that coarse machining is to be performed along P₅ through P₁ by the tool TL1 for coarse machining, fine machining is to be performed along P₆ through P₁₀ by the tool TL2 for fine machining, and grooving is to be performed along P₂₁ through P₂₄ by the grooving tool TL3. It should be noted that T₁, T₂, T₃ are the tool numbers of the tools TL1, TL2, TL3.

(3) When all data necessary for NC part program creation are entered through steps (1) and (2) above, a control program for creating a part program which is stored in a ROM 104 of FIG. 2 starts to run, and a processor 105, through processing described below, creates a subprogram for each machining process, creates a main program for calling the subprograms in the desired machining process order, and creates, in a RAM 106, an NC part program obtained by combining the created subprograms and main programs. The processing for creating both the subprograms and the main program will now be described.

(3a-1) The processor 105 determines whether a j-th machining process (where the initial value of j is 1) exists. If it does, the category of machining process (coarse machining, fine machining, grooving, threading, etc.) is recognized from the tool used in the process. A table 107 in FIG. 2 stores the correlation between machining category and the tool used to perform the machining. The processor 105 identifies the category of the j-th machining process based on the information in the table 107.

(3a-2) In order to create a subprogram for rough machining, which is the first machining process (j=1), the processor 105 generates a subprogram number for the j-th machining process, namely:

    O000j

The processor stores the number in the RAM 106 and then uses the initial position (x_(o), z_(o)) of the tool rest TBS stored in the RAM 103 to create NC data for setting the coordinate system, namely:

    G50Xx.sub.o Zz.sub.o ;

The processor stores this data in the RAM 106.

(3a-3) The processor 105 then calculates the position x_(s), z_(s) of the tool rest TBS that will exist when the nose of the tool TL1 is situated at the machining starting point P₂, which is spaced from the point P_(m) (FIG. 4) by the clearance c along both the X and Z axes. This position of the tool rest is calculated using the following equations where c is the clearance distance for coarse machining:

    X.sub.m +c+ΔX.sub.1 →x.sub.s

    z.sub.m +c+ΔZ.sub.1 →z.sub.s

When the coordinates of the machining starting point P_(s) have been calculated, the processor creates the following data for effecting positioning from the initial position to the machining starting point P_(s) :

    G00Xx.sub.s Zz.sub.s ;

and stores the data in the RAM 106.

(3a-4) Next, the processor 105 performs the operation 1→i and calculates the position x_(a), z_(a) of the tool rest TBS that will exist when the nose of the tool TL1 is situated at a point P_(ai) (=P_(a1)), which is spaced from the machining starting point P_(s) by (c+d) (where c is the clearance distance for coarse machining and d is th depth of cut) along the -X axis. This position of the tool rest is calculated from the following equations:

    x.sub.m -d+ΔX.sub.1 →x.sub.a

    z.sub.m +c+ΔZ.sub.1 →z.sub.a

(3a-4) After x_(a), z_(a) are calculated, the processor 105 determines whether the following holds:

    x.sub.a '≧(x.sub.5 +t)

(where x_(a) ', x₅ are the X-axis coordinate values of points P_(ai) (=P_(a1)) and P₅, respectively).

(3a-5) If x_(a) '≧(x₅ +t) holds, the processor 105 obtains a point P_(bi) (=P_(b1)), which is where a straight line L_(1i) parallel to the Z axis and passing through the point P_(ai) (Pa₁) intersects the part contour, and then obtains the position x_(b), z_(b) of the tool rest TBS that will exist when the nose of the tool TL1 is situated at a point P_(b1) ', which is spaced from the point of intersection P_(b1) by the finishing margin t along the +Z axis. The processor also calculates the coordinate values x_(c), z_(c) of a point P_(c1) which is spaced from the point P_(b1) ' by (d+u) along the +X axis, where u is the finish cut increment. These coordinate values are calculated from the following equations:

    x.sub.b '+d+u→x.sub.c

    z.sub.b '→z.sub.c

(where x_(b) ', z_(b) ' are the coordinate values of the point P_(b1) ').

(3a-6) The processor 105 then determines whether a straight line L₂₁ (=L₂₁) parallel to the Z axis and passing through the point P_(c1) intersects the part contour.

(3a-7) If the straight line L₂₁ does not intersect the part contour, the processor 105 obtains the point of intersection P_(d1) between the straight line L₂₁ and the extension of a straight line segment P₂ P₁ containing the point P_(b1), which straight line segment is from among the straight line segments P₅ P₄, P₄ P₃, P₃ P₂, P₂ P₁ that specify the part contour. Thereafter, the processor calculates the position x_(d), z_(d) of the tool rest that will exist when the nose of the tool TL1 is at a point P_(d1) ', which is spaced from the point of intersection P_(d1) by the finishing margin t.

(3a-8) Next, the processor 105 calculates the position x_(s), z_(s) of the tool rest TBS that will exist when the nose of the tool TL1 is at the next machining starting point P_(s1). This position is calculated from the following equations:

    x.sub.c +ΔX.sub.1 →x.sub.s

    z.sub.m +c+ΔZ.sub.1 →z.sub.s

(3a-9) When the coordinate values of each of the points occupied by the tool rest TBS have been found through the foregoing steps, the processor 105 uses these coordinate values to create and store the following in the RAM 106:

G00Xx_(a) Zz_(a) ;

G01Xx_(b) Zz_(b) Ff_(c) ;

Xx_(d) Zz_(d) ;

G00Xx_(s) Zz_(s) ;

(3a-10) The processor 105 then performs the operation i+1→i and calculates the position x_(a), z_(a) of the tool rest TBS that will exist when the nose of the tool TL1 is situated at a point P_(ai) (=P_(a2)), which is spaced from the machining starting point P_(s1) by (2d+u) along the -X axis. This position of the tool rest is calculated from the following equations:

    x.sub.s -(2d+u)→x.sub.a

    z.sub.s →z.sub.a

Thereafter, the processor repeats the process steps from step (3a-4) onward.

(3a-11) If the straight line L_(2i) (e.g., straight line L₂₂) is found to intersect the part contour at a point P_(di) in step (3a-6), then the processor calculates the position x_(d), z_(d) of the tool rest TBS that will exist when the nose of the tool TL1 is situated at a point P_(di) ', which is spaced from the point of intersection P_(di) (along the Z axis) by the finishing margin t.

(3a-12) Next, the processor 105 determines whether points P₁ through P₅, which specify the part contour, are located between points P_(bi) and P_(di). If the points P₁ through P₅ are not located between P_(bi) and P_(di), then processing from step (3a-8) onward is repeated.

(3a-13) If at least one of the points P₁ through P₅ (P₂, P₃) is found to lie between point P_(bi) and point P_(di) in executing step (3a-12), then the processor obtains the positions x₃ ', z₃ ' and x₂ ', z₂ ' of the tool rest TBS that will exist when the nose of the tool TL1 is respectively at points P₃ ', P₂ ', which are respectively spaced from the points P₃ and P₂ by the finishing margin t along both the +X and +Z axes. These positions are obtained from the following equations:

    x.sub.3 +t+ΔX.sub.1 →x.sub.3 '

    z.sub.3 +t+ΔZ.sub.1 →z.sub.3 '

    x.sub.2 +t+ΔX.sub.1 →x.sub.2 '

    z.sub.2 +t+ΔZ.sub.1 →z.sub.2 '

The processor 105, through processing similar to that of step (3a-8), then obtains the position x_(s), z_(s) of the tool rest TBS that will exist when the nose of the tool TL1 is at the next machining starting point P_(si). Thereafter, the processor uses the coordinate values of each of the positions occupied by the tool rest to create and store the following data in the RAM 106:

G00Xx_(a) Zz_(a) ;

G01Xx_(b) Zz_(b) Ff_(c) ;

X_(x3) ' Z_(z3) ';

X_(x2) ' Z_(z2) ';

X_(xd), Z_(zd) ;

G00Xx_(s) Zz_(s) ;

This is followed by repeating processing from step (3a-10) onward.

(3a-14) If x_(a) <(x₅ +t) is found to hold in step (3a-4), the processor calculates the position x₅ ', z₅ ' of the tool rest TBS that will exist when the nose of the tool TL1 is situated at the point P₅ ', which is spaced from the point P₅ by the finishing margin t along the +X axis and by the clearance c along the +Z axis. This position of the tool rest is calculated from the following equations:

    x.sub.5 +t+ΔX.sub.1 →x.sub.5 '

    z.sub.5 +c+ΔZ.sub.1 →z.sub.5 '

The processor also calculates the position x₄ ', z₄ ' of the tool rest TBS that will prevail when the nose of the tool TL1 is situated at the point P₄ ', which is spaced from the point P₄ by the finishing margin t along both the +X and +Z axes. This position of the tool rest is calculated from the following equations:

    x.sub.4 +t+ΔX.sub.1 →x.sub.4 '

    z.sub.4 +t+ΔZ.sub.1 →z.sub.4 '

This is followed by obtaining the coordinate values x_(c), z_(c) of a point P_(cn), which is spaced from the point P₄ ' by (d+u) along the +X axis. These coordinate values are obtained from the following equations:

    x.sub.4 +t+d+u→x.sub.c

    z.sub.4 +t→z.sub.c

The processor then obtains the position x_(d) ', z_(d) ' of a point P_(dn) at which the part contour is intersected by a straight line L2n parallel to the Z axis and passing through the point P_(cn), followed by the coordinate values x_(d), z_(d) and x_(e), z_(e) of the tool rest TBS that will exist when the nose of the tool TL1 is respectively at points P_(dn) ' (=P_(cn) '), P_(e) which are spaced from the point P_(dn) by the finishing margin t and by the clearance c, along the +Z axis. These coordinate values are obtained from the following equations:

    x.sub.d '+ΔX.sub.1 →x.sub.d

    z.sub.d '+t+ΔZ.sub.1 →z.sub.d

    x.sub.d →x.sub.e

    z.sub.d '+c+ΔZ.sub.1 →z.sub.e

The processor then obtains the position x_(f), z_(f) of the tool rest TBS that will exist when the nose of the tool TL1 is at the machining end point P_(f), the position being found from the equations:

    x.sub.m +c+66 X.sub.1 →x.sub.f

    z.sub.e →z.sub.f

When the coordinate values of the tool rest TBS at each of the points have been found through the foregoing steps, the processor 105 creates and stores the following in the RAM 106:

G00 Xx₅ ' Zz₅ ';

G01 Xx₄ ' Zz₄ ' Ff_(c) ;

Xx_(d) Zz_(d) ;

Xx_(e) Zz_(e) ;

G00 Xx_(f) Zz_(f) ;

M99

Note that M99 denotes the end of the subprogram.

The foregoing ends processing for creating the subprogram of the first machining process (coarse machining).

Upon completing processing for creating the subprogram for the first machining operation, the processor 105 executes processing to create a subprogram SP2 for the second machining process for performing fine machining, which subprogram includes fine machining work and control of tool rest movement.

When coarse machining is completed, the tool rest TBS is retracted along the +Z axis from the coarse machining end point P_(f) to the point P_(r) shown in FIG. 1(C), and is then transported along the -X axis from point P_(r) to point P_(t) shown in FIG. 1(D). Moving the tool rest in this manner positions the fine machining tool TL2 at the fine machining starting point along the shortest traveling distance without the tools striking the workpiece WK.

(3b-1) Accordingly, the processor 105 generates, and stores in the RAM 106, the following subprogram number of the second machining process:

    O 0002

(3b-2) The processor then obtains the maximum tool length (ΔZ₂) from among ΔZ₁, ΔZ₂, ΔZ₃ and subsequently calculates the coordinate values x_(r), z_(r) of the point P_(r) from the following equations:

    x.sub.m +c→x.sub.r

    z.sub.6 +ΔZ.sub.2 +c→z.sub.r

It should be noted that z₆ is the Z-axis coordinate value of the point P6.

(3b-3) The processor 105 also calculates the coordinates values x_(t), z_(t) of the point P_(t) from the following equations:

    -(x.sub.6 +ΔX.sub.2)→x.sub.t

    z.sub.r →z.sub.t

It should be noted that x₆ is the X-axis coordinate value of the point P₆.

(3b-4) When the points P_(r) and P_(t) have been found, the processor creates and stores the following NC data in the RAM 106:

G00 Xx_(r) Zz_(r) ;

Xx_(t) Zz_(t) ;

Thus, the processor creates NC data for movement along the +Z axis from point P_(f) to point P_(r), and NC data for movement along the -X axis from point P_(r) to point P_(t).

(3b-5) Next, the processor 105 calculates the positional coordinate values x_(i) ', z_(i) ' (i=7, 8 . . . 12) of the tool rest TBS that will exist when the nose of the tool TL2 (as shown in FIG. 4) is situated at points P₇, P₈, P₉, P₁₀, P₁₁, P₁₂, respectively. These coordinate values are calculated from the following equations:

    x.sub.i -ΔX.sub.2 →x.sub.i '

    z.sub.i -ΔZ.sub.2 →z.sub.i '

(where i=7, 8, 9, 10)

    x.sub.10 -c-ΔX.sub.2 →x.sub.11 '

    z.sub.11 +ΔZ.sub.2 →z.sub.11 '

    x.sub.11 '→x.sub.12 '

    z.sub.6 +c+ΔZ.sub.2 →z.sub.12 '

where z₁₁ is the Z-axis coordinate value of the point of intersection between straight lines P₉ P₁₀, P₁₁ P₁₂.

(3b-6) When the coordinates x_(i) ', z_(i) ' have been obtained, the processor creates, and stores in the RAM 106, the following path data for transporting the tool TL2 along the fine machining path:

G01 Xx₇ ' Zz₇ ' Ff_(c) ;

Xx₈ ' Zz₈ ';

Xx₉ ' Zz₉ ';

Xx₁₁ ' Zz₁₁ ';

G00 Xx₁₂ ' Zz₁₂ ';

Xx_(t) Zz_(t) ;

M99;

Thus, performing steps (3b-1) through (3b-6) ends processing for the creation of a subprogram for the second machining process (fine machining).

(3c) Thereafter, a subprogram SP3 for the third machining process, which program includes grooving machining work and control of tool rest movement for cutting a groove, is created through steps similar to those used to create the subprogram SP2. This completes the processing for the creation of all subprograms.

(3d) When all subprograms have been created, the processor 105 creates the following main program for calling the subprograms in machining process order:

O1234

M98 P0001;

M98 P0002;

M98 P0003;

M30;

and ends creation of the part program by arranging the part program in the RAM 106 in the order shown in FIG. 8, namely in the order of the main program MP, subprogram SP1, subprogram SP2 and subprogram SP3. The part program stored in the RAM 106 is subsequently delivered as an output to a tape puncher or magnetic unit 201. Note that "M98" denotes a subprogram call instruction for calling the subprogram having the program under which follows the letter of the alphabet "P", "M99" denotes end of the subprogram, and "M30" denotes end of the program.

(II) Machining Processing

Machining processing performed by a comb-cutter lathe will now be described with reference to FIG. 9 which is a block diagram of an NC apparatus, and FIG. 10 which is a flowchart of machining processing.

An NC tape 301 records NC data created by the NC tape creating apparatus of FIG. 2. A processor 302 responds to a read request produced by an operator's panel 303 by actuating an NC data reading device 304 to store, in a RAM 305, all of the NC data recorded on the NC tape 301.

(1) When a start button on the operator's panel 303 is pressed under these conditions, the processor 302, under the control of a control program stored in a ROM 306, sets the sequence number i of the main program to 1, stores the sequence number in a general-purpose register 302a and reads the i-th block of NC data constituting the main program out of the RAM 305.

(2) The processor 302 determines whether the read NC data is an instruction "M30" indicative of the end of the program. If it is, the processor ends NC processing.

(3) If the NC data is not "M30", on the other hand, the processor 302 sets the sequence number j of a subprogram to 1 and stores the sequence number in a general-purpose register 302b. The processor 302 then goes to the RAM 305 and, from among the NC data read in step (1), reads out NC data belonging to the j-th block of the subprogram designated by the subprogram number which follows the letter of the alphabet "P" stored in a general-purpose register 302c.

(4) The processor 302 determines whether the NC data belonging to the j-th block of the subprogram is "M99".

(5) If the NC data is "M99", the following operation is performed:

    i+1→i

after which the NC data belonging to the i-th block of the main program is read. Processing from step (2) onward is repeated.

(6) If the NC data belonging to the i-th block of the subprogram is NC data for path control rather than "M99", however, ordinary path control processing is carried out. For example, if the NC data is data such as:

G00 Xx_(r) Zz_(r) ;

for moving the tool rest TBS from point P_(f) (FIG. 4) to point P_(r), then the processor 303 calculates incremental values X_(j), Z_(j) along the respective axes from point P_(f) to point P_(r) (actually, X_(j) =0).

Thereafter, velocity components F_(x), F_(z) along the respective axes are calculated in accordance with the following equations from rapid-traverse velocity F_(r) and X_(j), Y_(j), which are stored in a parameter memory 307: ##EQU1## Next, in accordance with the following equations, there are obtained traveling distances ΔX, ΔZ for movement along the respective axes during a period of time ΔT sec (=8 msec) which is stored in the parameter memory 307:

    ΔX=F.sub.x ·ΔT

    ΔZ=F.sub.z ·ΔT

Values are stored in a working memory 308. When ΔX, ΔZ have been obtained, the processor 303 applies them as inputs to a pulse distributor 309 every ΔT sec. Based on the input data ΔX, ΔZ, the pulse distributor 309 performs simultaneous two-axis pulse distribution computations to generate distributed pulses X_(p), Z_(p), which are applied as inputs to X- and Z-axis servomotors 310X, 310Z. As a result, X- and Z-axis motors 311X, 311Z, respectively, for driving the tool rest, are rotated to transport the tool rest toward the point P_(r).

The processor 303, in accordance with the following formulae, updates the present position X_(a), Z_(a) along the respective axes every ΔT sec, the updated values of X_(a) and Z_(a) being stored in the working memory 303:

    X.sub.a ±ΔX→X.sub.a

    Z.sub.a ±ΔZ→Z.sub.a

The sign depends upon the direction of movement. Similarly, in accordance with the following formulae, the processor updates remaining traveling distances remaining to be travelled X_(r), Z_(r) (the initial values of which are X_(i), Z_(i), respectively) every ΔT sec, the updated values of X_(r) and Z_(r) being stored in the working memory 308:

    X.sub.r-Δ X→X.sub.r

    Z.sub.r-Δ Z→Z.sub.r

When the tool rest TBS arrives as the point P_(r) and the following condition is established, X_(r) =Z_(r) =0 (i.e., the distance remaining to be travelled is zero) the processor 303 ends path control processing.

(7) The processor 303 increments the sequence number j of the subprogram by performing the following operation:

    j+1→j

reads the NC data belonging to the j-th block of the subprogram designated by the subprogram number stored in the general-purpose register 302c, and repeats processing from step (4) onward. If the NC data read next is path control NC data for moving the tool rest from point P_(r) to point P_(t) and path control processing similar to the foregoing is to be performed thereafter, the tool rest is positioned at point P_(t).

Thus, according to the present invention, the arrangement is such that when changing tools in a comb-cutter lathe, the tool rest is temporarily retracted along the Z axis so that a tool will not interfere with the workpiece when moved along the X axis, and the tool rest is then moved along the X axis to position a selected toll at the X coordinate of a point at which machining is be started by the tool. In changing tools, therefore, a tool will not interfere with the workpiece even when the tool rest is moved along the axis.

Further, according to the present invention, an NC part program for a comb-cutter lathe can be created merely by entering part dimensions, a tool selection sequence, machining location and tool mounting position, etc., and the path followed by a tool rest can be generated automatically without specifying the path of the tool rest when selecting a tool.

In addition, the present invention makes it possible to minimize the traveling distance of a tool rest during tool selection so that the total time required to change tools can be reduced.

While the foregoing description relates to a case where the two tools TL1 and TL2 are provided in juxtaposition on the tool rest, the invention is not limited to two tools but can be applied to three or more tools mounted on a tool rest. Further, though the description given above regards a transition from machining in the first quadrant to machining in the fourth quadrant, the invention is not limited to such but can be applied to various configurations in which machining is exercised from the fourth to the first quadrant or within one and the same quadrant, etc.

In numerically controlling a comb-cutter lathe, the present invention prevents a tool from interfering with a workpiece, enables the path of a tool rest at the time of a tool change to be generated automatically, and minimizes the length of the tool path. The invention is therefore well-suited for application to control of a comb-cutter lathe. 

We claim:
 1. A method of controlling a comb-cutter lathe having a tool rest movable in an X-Z orthogonal coordinate system, the tool rest having two or more juxtaposed tools mounted thereon for subjecting a workpiece, having a turning axis coinciding with the Z-axis, to machining by using predetermined ones of the tools in succession, such that after machining is completed in a first quadrant by one tool the tool rest is moved in order to position another one of the tools at a machining location in a second quadrant and machining is preformed by the other tool, said method comprising the steps of:(a) automatically moving the tool rest along the Z-axis to a point P_(r) at which none of the tools will contact the workpiece when the tool rest is moved along the Z-axis from the first quadrant to the second quadrant, a Z-axis coordinate value of the point P_(r) being determined in accordance with a maximum length of said juxtaposed tools; (b) selecting one of the tools for machining the workpiece in the second quadrant; (c) automatically moving the tool rest along the X-axis from the point P_(r) to a point P_(t), in the second quadrant at which an X-axis position of the selected tool coincides with an X-axis coordinate value of a machining starting point at which machining is to be started by the selected tool; and (d) performing machining in the second quadrant using the selected tool.
 2. A method of controlling a comb-cutter lathe according to claim 1, wherein a Z-axis coordinate value z' of said point P_(r) is calculated from the following:

    z'=z+ΔZ+c

where z is a Z-axis coordinate value of said machining starting point position, c is a clearance quantity, and ΔZ is a distance measured along the Z axis from a reference point on the tool rest to a distal end of a tool having the longest length among the tools mounted on the tool rest.
 3. A method of controlling a comb-cutter lathe according to claim 2, wherein an X-axis coordinate value x' of said point P_(r) is calculated from the following:

    x'=x+ΔX+c

where x is an X-axis coordinate value of said machining starting point position, c is a clearance quantity and ΔX is a distance measured along the X axis from the reference point on the tool rest to a distal end of the selected tool.
 4. A method of controlling a comb-cutter lathe according to claim 1, wherein said lathe is controlled an NC controller and wherein step (d) comprises the substeps of:(1) entering part dimensions of a part to be machined into the NC controller; (2) entering a tool selection sequence; (3) entering a machining start location for each of the tools; (4) entering mounting dimensions information of the tools measured from a reference point on the tool rest to a distal point on each tool; and (5) sequentially performing machining based on the entered information using predetermined tools in accordance with said tool selection sequence and starting machining with each tool at a corresponding one of each machining start locations assigned to said tools.
 5. A method of controlling a comb-cutter lathe having a tool rest movable in an X-Z orthogonal coordinate system, the tool rest having two or more tools mounted thereon for subjecting a workpiece, having a turning axis coinciding with the Z-axis, to machining, said method comprising the steps of:(1) selecting a machining start point spaced from the workpiece by a clearance quantity c; (2) selecting a tool for machining the workpiece; (3) determining the desired shape of the workpiece; (4) determining the mounting position of each of said tools with respect to a reference point on the tool rest; (5) determining a machining end point for said selected tool in accordance with said clearance quantity c and said mounting position of the selected tool; (6) machining the workpiece in accordance with the desired shape, the clearance quantity c and said mounting position of the selected tool until said machining end point is reached; (7) determining a longest tool having a distal point spaced along the Z axis first from said reference point on the tool rest; (8) determining a point P_(r) in accordance with said desired shape of the workpiece, said clearance quantity c, and the mounting position of the longest tool, such that the distal point of said longest tool is spaced from the workpiece by not less than the quantity c when the tool rest is moved along the Z-axis; (9) moving the tool rest to the point P_(r) ; (10) selecting another tool for machining the workpiece; (11) determining a point P_(t) in accordance with the mounting position of said another tool, the point P_(r) and said desired shape of the workpiece; (12) moving the tool rest to the point P_(t), (13) determining a tolerance quantity t of said desired shape of said workpiece; and (14) machining the workpiece with said another tool in accordance with said tolerance quantity t and said desired shape of the workpiece. 